﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="DataAccessGroup.aspx.cs" Inherits="PEXAM.Admin.Page_Admin.DataAccessGroup" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            width: 300px;
        }
        .style3
        {
        }
        .style5
        {
        }
        .RadGrid_Office2007 .rgHeader
        {
            color: #00156e;
        }
        .RadGrid_Office2007 .rgHeader
        {
            border: solid #5d8cc9;
            border-width: 0 0 1px 1px;
            background: 0 -2300px repeat-x #c3d8f1 url(                          'mvwres://Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Office2007.Grid.sprite.gif' );
        }
        .RadGrid .rgHeader
        {
            padding-top: 5px;
            padding-bottom: 4px;
            text-align: left;
            font-weight: normal;
        }
        .RadGrid .rgHeader
        {
            padding-left: 7px;
            padding-right: 7px;
        }
        .RadGrid .rgHeader
        {
            cursor: default;
        }
        .RadGrid_Office2007 .rgFilterRow
        {
            background: #d6e5f3;
        }
        .style6
        {
            font-weight: bold;
            color: #0000CC;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlacebody" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    </telerik:RadCodeBlock>
    <table style="width: 100%;" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center" class="formTitle" colspan="2">
                DataAcess Group
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
                <asp:Label ID="lbErr" runat="server" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div style="margin: auto auto 20px auto; width: 350px">
                    <telerik:RadButton ID="btnNew" runat="server" Text="Add New" SplitButtonCssClass=""
                        SplitButtonPosition="Right" OnClick="btnNew_Click" Width="100px">
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"
                        Width="100px">
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"
                        Width="100px">
                    </telerik:RadButton>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td class="style3">
                            &nbsp;
                        </td>
                        <td class="style5">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            <asp:Label ID="lbROLE_ID" runat="server" Text="Code"></asp:Label>
                        </td>
                        <td class="style5">
                            <telerik:RadTextBox ID="txtRoleId" runat="server" MaxLength="5">
                            </telerik:RadTextBox>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            <asp:Label ID="Label4" runat="server" Text="Name"></asp:Label>
                        </td>
                        <td class="style2">
                            <telerik:RadTextBox ID="txtRoleName" runat="server" Width="200px">
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            &nbsp;
                        </td>
                        <td class="style5">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Include/Exclude
                        </td>
                        <td class="style5">
                            <telerik:RadTextBox ID="txtPassLen" runat="server" Width="30px" MaxLength="1">
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            Groups
                        </td>
                        <td class="style5">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style3" colspan="2">
                            <telerik:RadGrid ID="dgvPOG" runat="server" AutoGenerateColumns="False" GridLines="None"
                                Skin="Office2007" AllowMultiRowSelection="True" OnNeedDataSource="dgvPOG_NeedDataSource"
                                OnDeleteCommand="dgvPOG_DeleteCommand" OnInsertCommand="dgvPOG_InsertCommand"
                                OnUpdateCommand="dgvPOG_UpdateCommand" OnItemDataBound="dgvPOG_ItemDataBound">
                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
                                </HeaderContextMenu>
                                <MasterTableView PageSize="20" DataKeyNames="ROLE_ID,DAG_ID" EditMode="InPlace" CommandItemDisplay="Top">
                                    <CommandItemSettings ExportToPdfText="Export to Pdf" ShowRefreshButton="false"></CommandItemSettings>
                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                    </ExpandCollapseColumn>
                                    <Columns>
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
                                            <HeaderStyle Width="20px" />
                                            <ItemStyle CssClass="MyImageButton" />
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridBoundColumn DataField="DAG_ID" FilterControlAltText="Filter column column"
                                            HeaderText="DAG_ID" UniqueName="column2" Visible="False">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn HeaderText="Group" ItemStyle-Width="240px" DataField="ROLE_ID">
                                            <ItemTemplate>
                                                <%#DataBinder.Eval(Container.DataItem, "ROLE_ID")%>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="ROLE_ID" DataValueField="ROLE_ID"
                                                    EnableLoadOnDemand="True" OnItemsRequested="cboPOG_ItemsRequested" OnSelectedIndexChanged="OnSelectedIndexChangedHandler">
                                                </telerik:RadComboBox>
                                            </EditItemTemplate>
                                            <ItemStyle Width="240px"></ItemStyle>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn FilterControlAltText="Filter column1 column" HeaderText="Name"
                                            UniqueName="column1" DataField="ROLE_NAME" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridButtonColumn CommandName="Delete" FilterControlAltText="Filter column3 column"
                                            Text="Delete" UniqueName="column3" ButtonType="ImageButton">
                                        </telerik:GridButtonColumn>
                                    </Columns>
                                    <EditFormSettings>
                                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                        </EditColumn>
                                    </EditFormSettings>
                                </MasterTableView>
                                <ClientSettings>
                                    <Selecting AllowRowSelect="True" />
                                </ClientSettings>
                                <FilterMenu EnableImageSprites="False">
                                </FilterMenu>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <div style="width: 100%">
                    <span class="style6">Data Access List</span>
                    <telerik:RadGrid ID="dgvList" runat="server" AutoGenerateColumns="False" GridLines="None"
                        Skin="Office2007" AllowFilteringByColumn="True" AllowMultiRowSelection="True"
                        AllowPaging="True" AllowSorting="True" OnItemCommand="dgvList_ItemCommand" ShowGroupPanel="True"
                        OnNeedDataSource="dgvList_NeedDataSource">
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
                        </HeaderContextMenu>
                        <MasterTableView PageSize="20" DataKeyNames="DAG_ID">
                            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                <HeaderStyle Width="20px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridButtonColumn CommandName="Selected" FilterControlAltText="Filter column column"
                                    Text="Edit" UniqueName="column4">
                                </telerik:GridButtonColumn>
                                <telerik:GridClientSelectColumn FilterControlAltText="Filter column column" UniqueName="column8">
                                </telerik:GridClientSelectColumn>
                                <telerik:GridBoundColumn FilterControlAltText="Filter column2 column" HeaderText="Code"
                                    UniqueName="column2" DataField="DAG_ID">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterControlAltText="Filter column1 column" HeaderText="Name"
                                    UniqueName="column1" DataField="NAME">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="True">
                            <Selecting AllowRowSelect="True" />
                        </ClientSettings>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hdCategory" runat="server" />
    <asp:HiddenField ID="hdCode" runat="server" />
    <br />
    <br />
</asp:Content>
